1. Field of the Invention
The present invention relates to a system, method and computer program for intelligently batching messages for distribution in a data processing system. More particularly, the present invention relates to a technique for intelligently batching messages for distribution across a process or nodal boundary for a distributed application.
2. Description of the Related Art
Distributed software applications (programs) have gained in popularity recently as they permit enhanced performance by distributing tasks among processors and utilizing otherwise under-utilized processing power. Distributed applications rely on multiple processes running in different nodes to perform or execute the application. Each process typically has multiple threads associated therewith and is usually associated a single computer or processor, although more than one process can exist on a given processor.
With the advent of object oriented languages, the full oriented applications execute by sending messages utilizing names between objects which comprise the application. This is fundamentally different from most applications written in procedural computer languages, in which code modules are identified by their address. This feature of object oriented applications potentially relieves the application developer of the horrific task of having to specifically hard code communications between threads of a distributed application operating in different nodes by local address in order to ensure proper node-to-node communication. In distributed object oriented applications, a "send thread" or routine is typically established within each node or process or object space or address space relative to each potential destination node or process or object space or address space to which messages may be sent.
Relatively slow performance or speed of object oriented applications has been identified as a drawback of using object oriented applications. While performance of object oriented applications operating within a single node has been greatly improved recently, performance issues for distributed applications have received much less attention. One major source of delays has been identified with regard to performance issues of distributed object oriented applications. The performance of a distributed application is greatly affected by the time it costs for messages to be sent from node to node over the network. Sending messages from object to object across nodal boundaries takes several times longer than does sending a message between objects within the same node or object space. The basic prior art technique for sending messages across nodal boundaries calls for simple polling of each send thread within a given process such that each sending thread is polled regularly, such as every 15 milliseconds, and if at least one message is ready or waiting to be sent, all waiting messages are sent. However, this technique is quite inefficient and affects performance because the send threads are constantly polled and responsiveness is tied to the frequency of polling. The less frequent the polling, the greater the amount of batching that occurs, but the application is less responsive. When the polling is more frequent, less batching of messages occurs and more CPU cycles are wasted, but the application is very responsive.
One approach to enhance performance has been the use of pure batching. Batching simply means sending more than one message at a time. A basic batching scheme for a distributed application calls for send thread within a given node to wait until a predetermined number of messages has been delivered to a batch queue for delivery to a destination node. After the number of messages is in the queue, the send thread is given CPU access within the node and the batch of messages is sent out over the network together in a single communication to the destination node. Batching takes advantage of the fact that the cost in time relative to sending more than one message over a network together is much less than the cost of sending each message separately. However, for many applications, and particularly for distributed object oriented applications, this technique may not improve performance significantly and can cause the loss of responsiveness and performance. In extreme cases, if a batch communication is not to be sent until, for example, three messages are in the batch queue, the first and second messages could arrive at practically the same time in the queue, but it may take many seconds or minutes before the third message arrives in the queue and the messages can be sent. Such delays are often not acceptable, as overall processing may be delayed until processing is carried out by objects in the remote node in response to receipt of the messages.
Another attempt to enhance performance calls for the send process relative to a given destination node to interrupt the processing whenever it receives a message to be sent, thus causing the message to be sent virtually immediately. But, once again, this technique fails to optimize performance of the overall application. While such a scheme is quite responsive, no batching will typically occur.
Accordingly, a need exists for a technique by which messages are sent across nodal boundaries which enhances system performance.